const initialState = {
    showTab: 'show',
    tabWidth: '90%',
    scrollTop: 0,
}

const layoutModel = {
    namespace: 'layout',
    state: initialState,
    reducers: {
        setState(state , { payload }) {
            return {
                ...state,
                ...payload
            }
        }
    },
    effects: {
        *asyncSetLayout({callback, payload},  { call, put, select }) { 
            // let  {showTab, tabWidth, scrollTop}  = yield select(state => state.layout)
            // console.log(showTab, tabWidth, scrollTop);
            yield put({
                type: 'setState',
                payload: {
                    ...payload
                }
            })
        }
    }
}

export default layoutModel;